<?php

include_once ('bn_path.php');

class bn_download
{
    protected static $instance;

    public static function getInstance()
    {
        if (!isset(self::$instance))
        {
            self::$instance = new self();
        }
        return self::$instance;
    }
    
    public function download($filename)
    {
        header('Content-Description: File Transfer');
        header('Content-Type: application/octet-stream');
        header("Content-disposition: attachment; filename=" . basename($filename));
        header('Content-Transfer-Encoding: binary');
        header('Cache-Control: must-revalidate');
        header('Content-Length: ' . filesize($filename));
        readfile($filename);
        exit;
    }
}

?>